﻿
@{
    ViewBag.Title = Resources.WebStringsWeb.WebTitle;
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}
@section css {
    <link href="~/Assets/css/lib/bootstrap-select.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/bootstrap-datetimepicker.min.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/fileinput.css" rel="stylesheet" />
    <link href="~/Assets/css/jquery.step.css" rel="stylesheet" />
    <style>
        th {
            text-align: center;
            font-weight: bold;
        }

        td {
            text-align: center;
            vertical-align: middle;
        }

        #step {
            margin-bottom: 40px;
        }

        .center {
            position: fixed;
            top: 50%;
            left: 50%;
            background-color: #000;
            width: 600px;
            -webkit-transform: translateX(-50%) translateY(-50%);
            -moz-transform: translateX(-50%) translateY(-50%);
            -ms-transform: translateX(-50%) translateY(-50%);
            transform: translateX(-50%) translateY(-50%);
            border-radius: 3px;
        }

        .removeImage {
            position: relative;
            right: -55px;
            top: -12px;
            float: left;
            font-weight: bold;
            color: red;
        }
    </style>
}
<div class="page-content" ng-cloak ng-controller="CheckFormController" ng-init="page='@(Request.QueryString["page"].IsEmpty() ? "1" : Request.QueryString["page"])';
     PageName='@Request.CurrentExecutionFilePath.Substring(Request.CurrentExecutionFilePath.LastIndexOf("/") + 1)';
     pagename =  '@(Request.QueryString["pagename"].IsEmpty() ? "1" : Request.QueryString["pagename"])';
     TaskId = '@(Request.QueryString["TaskId"].IsEmpty() ? "1" : Request.QueryString["TaskId"])';
     TaskName = '@(Request.QueryString["TaskName"].IsEmpty() ? "" : Request.QueryString["TaskName"])';
     FormId='@(Request.QueryString["FormId"].IsEmpty() ? "" : Request.QueryString["FormId"])';
     SearchModel={};
     SearchModel.TaskId = TaskId;
     InitSpecialCheckStep();
     GetMySpecialCheckRecordList(SearchModel,page);
     ExcuteApproveTask(FormId);
     ">
    <div class="load" id="previewimg" ng-show="IsPreview" ng-click="ClosePreview();">
        <img id="imgshow" class="center" />
    </div>
    <div class="load" ng-show="DataLoading">
        <div class="loader">
            <svg version="1.1" id="loader-1" x="0px" y="0px" width="100px" height="100px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
            <path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
            <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite" />



			</path>
		</svg>
            <div class="load-msg" ng-bind="LoadingMsg"></div>
        </div>
    </div>
    <div class="page-heading">
        <h1>
            {{TaskName}}-检查台账
        </h1>
        <div class="options">
            <div class="btn-toolbar">
            </div>
        </div>
    </div>
    <ol class="breadcrumb">
        <li><a>主体业务</a></li>
        <li><a>安全检查</a></li>
        <li><a>专项检查</a></li>
        <li class="active"><a>检查台账</a></li>
    </ol>

    <div class="container-fluid">
        <div class="row">
            <form class="form-horizontal row-border">
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading"><h2>筛选条件</h2></div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-lg-12">
                                    <div class="form-group">
                                        <label class="col-sm-1 control-label">时间范围：</label>
                                        <div class="col-sm-2">
                                            <datepicker id="startTime" option="datetimeOption" format="L" ng-model="SearchModel.StartTime"></datepicker>
                                        </div>
                                        <div class="col-sm-2">
                                            <datepicker id="endtime" option="datetimeOption" format="L" ng-model="SearchModel.EndTime"></datepicker>
                                        </div>
                                        <div class="col-sm-1">
                                            <button class="btn btn-primary" ng-click="GetMySpecialCheckRecordList(SearchModel,1);">查询</button>
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </form>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div id="step"></div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h2>任务台账 总数：<b ng-bind="TotalCount"></b></h2>
                        <div class="panel-ctrls">
                            <div class="btn-group">
                                <a href="SpecialCheckPageList?&page={{page}}" class="btn btn-xs btn-inverse"><i class="fa fa-backward"></i>返回</a>
                                @*<a href="SpecialCheckAdd?Id={{TaskId}}&task={{TaskName}}&page=1" class="btn btn-xs btn-inverse"><i class="fa fa-plus"></i>检查登记</a>*@
                            </div>
                        </div>
                    </div>
                    <div class="panel-body">
                        <div class="text-center" ng-show="PageLoading">
                            <img src="~/Assets/img/loading.gif" />
                        </div>
                        <table class="table table-striped table-bordered table-hover" ng-show="!PageLoading">
                            <thead>
                                <tr>
                                    <th>序号</th>
                                    <th>任务名称</th>
                                    <th>检查时间</th>
                                    <th>部门</th>
                                    <th>登记人</th>
                                    <th>部门领导</th>
                                    <th>检查情况</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ng-show="SpecialCheckList.length==0">
                                    <td colspan="9">暂无数据</td>
                                </tr>
                                <tr ng-repeat="x in SpecialCheckList" ng-click="InitSpecialCheckStep(x.Status);">
                                    <td>{{$index+1}}</td>
                                    <td ng-bind="TaskName"></td>
                                    <td><b>{{x.CheckTime|JSONDate:'yyyy-MM-dd'}}</b></td>

                                    <td>{{x.DepartmentName}}</td>
                                    <td>{{x.CreateUserName}}</td>
                                    <td>{{x.DepartmentLeader}}</td>
                                    <td><span ng-show="!x.IsException" class="badge badge-success">正常</span><span ng-show="x.IsException" class="badge badge-danger">异常</span></td>
                                    <td>
                                        <span class="badge badge-primary" ng-show="x.Status==1 ">待审核</span>
                                        <span class="badge badge-inverse" ng-show="x.Status==0 && x.IsWithdraw==false">暂存</span>
                                        <a data-toggle="modal" ng-click="GetApproveLogList(x.FormId);" href="#ApproveDetail"><span class="badge badge-danger" ng-show="x.Status==0 && x.IsWithdraw==true">驳回</span></a>
                                        <span class="badge badge-success" ng-show="x.Status==2">已完成</span>
                                    </td>
                                    <td>
                                        <a id="{{x.FormId}}" ng-show="x.Status==1 && User.UserNo==x.DepartmentManager" data-toggle="modal" href="#CheckDetailModal" ng-click="GetSpecialCheckFormDetail(x.FormId);" class="btn btn-success btn-xs btn-label"><i class="fa fa-check-square"></i>审核</a>
                                        <a data-toggle="modal" href="#CheckDetailModal2" ng-click="GetSpecialCheckFormDetail(x.FormId);" class="btn btn-primary btn-xs btn-label"><i class="fa fa-info"></i>详细</a>
                                        <a ng-show="x.Status==0 && @ViewBag.IsModify==1" href="SpecialCheckEdit?Id={{x.FormId}}&task={{TaskName}}&page={{result.currentPage}}&TaskId={{TaskId}}" class="btn btn-default btn-xs btn-label"><i class="fa fa-pencil"></i>编辑</a>
                                        <a ng-show="x.Status==0 && @ViewBag.IsDelete==1" ng-click="DeleteSpecialCheckForm(x.FormId,SearchModel,result.currentPage)" class="btn btn-warning btn-xs btn-label"><i class="fa fa-trash"></i>删除</a>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="text-center" ng-show="SpecialCheckList.length>0">
                    <ul class="pagination  justify-content-center">
                        <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetMySpecialCheckRecordList(SearchModel,1);">首页</a></li>
                        <li class="page-item" ng-class="{'active':result.currentPage==page}" ng-repeat="page in result.pages"><a style="cursor:pointer;" ng-click="GetMySpecialCheckRecordList(SearchModel,page)" class="page-link" ng-bind="page"></a></li>
                        <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetMySpecialCheckRecordList(SearchModel,(result.currentPage + 1 > result.totalPage ? result.totalPage : result.currentPage + 1))">下一页</a></li>
                        <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetMySpecialCheckRecordList(SearchModel,result.totalPage);">尾页</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="CheckDetailModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="min-width:1050px;">
            <div class="modal-content" style="min-height: 700px;">
                <div class="modal-header">
                    <button type="button" id="close" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h2 class="modal-title">检查详细</h2>
                </div>
                <div class="modal-body" style="min-height: 560px;">
                    <form class="form-horizontal row-border">
                        <div class="form-group">
                            <label class="col-lg-1 control-label">
                                场所：
                            </label>
                            <div class="col-lg-10">
                                <label ng-repeat="y in SpecialCheckDetail.PlaceDetailList" class="control-label">{{y.PlaceName}}；</label>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-12">
                                <table class="table table-striped table-bordered table-hover" ng-show="!PageLoading">
                                    <thead>
                                        <tr>
                                            <th style="width:5%;vertical-align:middle;">序号</th>
                                            <th style="width:45%;vertical-align:middle;">检查内容</th>
                                            <th style="width:10%;">检查结果</th>
                                            <th style="width:10%;vertical-align:middle;">测量值</th>
                                            <th style="width:15%;vertical-align:middle;">照片</th>
                                            <th style="width:20%;vertical-align:middle;">备注</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr ng-repeat="x in SpecialCheckDetail.CheckItemList">
                                            <td>{{$index+1}}</td>
                                            <td style="text-align:left;">{{x.CheckContent}}</td>
                                            <td>
                                                <span ng-show="x.Result==1" class="label label-info">正常</span>
                                                <span ng-show="x.Result==0" class="label label-danger">异常</span>
                                            </td>
                                            <td>
                                                <b>{{x.DataValue}}</b>
                                            </td>
                                            <td>
                                                <div style="float:left;margin-left:10px;" ng-repeat="i in x.FileList">
                                                    <img ng-click="ShowPicture(i.FilePath);" src="{{i.FilePath}}" width="50" />
                                                </div>
                                            </td>
                                            <td>{{x.Remark}}</td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>

                        </div>
                        <div class="form-group">
                            <label class="col-sm-1 control-label">备注：</label>
                            <div class="col-sm-11">
                                <textarea rows="3" class="form-control" ng-model="LogModel.Remark">
                            </textarea>
                            </div>
                        </div>

                    </form>
                    
                </div>
                <div class="modal-footer">
                    <div class="col-md-1">
                        <button class="btn-primary btn" ng-click="ApproveSpecialCheckForm(currentid,2,SearchModel,result.currentPage,pagename);">通过</button>
                    </div>
                    <div class="col-md-1">
                        <button class="btn-danger btn" ng-click="ApproveSpecialCheckForm(currentid,0,SearchModel,result.currentPage,pagename);">驳回</button>
                    </div>
                </div>
            </div>
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
    <div class="modal fade" id="CheckDetailModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="min-width:1050px;">
            <div class="modal-content" style="min-height: 700px;">
                <div class="modal-header">
                    <button type="button" id="close" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h2 class="modal-title">检查详细</h2>
                </div>
                <div class="modal-body" style="min-height: 560px;">
                    <form class="form-horizontal row-border">
                        <div class="form-group">
                            <label class="col-lg-1 control-label">
                                场所：
                            </label>
                            <div class="col-lg-10">
                                <label ng-repeat="y in SpecialCheckDetail.PlaceDetailList" class="control-label"><b>{{y.PlaceName}} </b></label>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-12">
                                <table class="table table-striped table-bordered table-hover" ng-show="!PageLoading">
                                    <thead>
                                        <tr>
                                            <th style="width:5%;vertical-align:middle;">序号</th>
                                            <th style="width:45%;vertical-align:middle;">检查内容</th>
                                            <th style="width:10%;">检查结果</th>
                                            <th style="width:10%;vertical-align:middle;">测量值</th>
                                            <th style="width:15%;vertical-align:middle;">照片</th>
                                            <th style="width:20%;vertical-align:middle;">备注</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr ng-repeat="x in SpecialCheckDetail.CheckItemList">
                                            <td>{{$index+1}}</td>
                                            <td style="text-align:left;">{{x.CheckContent}}</td>
                                            <td>
                                                <span ng-show="x.Result==1" class="label label-info">正常</span>
                                                <span ng-show="x.Result==0" class="label label-danger">异常</span>
                                            </td>
                                            <td>
                                                <b>{{x.DataValue}}</b>
                                            </td>
                                            <td>
                                                <div style="float:left;margin-left:10px;" ng-repeat="i in x.FileList">
                                                    <img ng-click="ShowPicture(i.FilePath);" src="{{i.FilePath}}" width="50" />
                                                </div>
                                            </td>
                                            <td>{{x.Remark}}</td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>

                        </div>


                    </form>

                </div>

            </div>
        </div><!-- /.modal-dialog -->
    </div>
    <div class="modal fade" id="ApproveDetail" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="min-width:1050px;">
            <div class="modal-content" style="min-height: 700px;">
                <div class="modal-header">
                    <button type="button" id="close" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h2 class="modal-title">检查详细</h2>
                </div>
                <div class="modal-body" style="min-height: 590px;">

                    <table class="table table-striped table-bordered table-hover" ng-show="!PageLoading">
                        <thead>
                            <tr>
                                <th style="width:5%;vertical-align:middle;">序号</th>
                                <th style="width:20%;vertical-align:middle;">审核人</th>
                                <th style="width:20%;">审核时间</th>
                                <th style="width:20%;vertical-align:middle;">审核结果</th>
                                <th style="width:20%;vertical-align:middle;">备注</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr ng-repeat="x in ApproveLogList">
                                <td>{{$index+1}}</td>
                                <td>{{x.CreateUserName}}</td>
                                <td>{{x.CreateTime|JSONDate:'yyyy-MM-dd HH:mm'}}</td>
                                <td>
                                    <span ng-show="x.Result" class="label label-info">通过</span>
                                    <span ng-show="!x.Result" class="label label-danger">驳回</span>
                                </td>
                                <td>{{x.Remark}}</td>
                            </tr>
                        </tbody>
                    </table>
                </div>

            </div>
        </div><!-- /.modal-dialog -->
    </div>
</div>


@section Js{
    <script src="~/Assets/js/libs/jquery.step.min.js"></script>
    <script src="~/Assets/js/pg/CheckForm.js?v=@DateTime.Now.ToString("yyMMddHHmm")"></script>
    <script src="~/Assets/js/libs/moment.min.js"></script>
    <script src="~/Assets/js/libs/locales/date/zh-cn.js"></script>
    <script src="~/Assets/js/libs/bootstrap-datetimepicker.min.js"></script>
    <script src="~/Assets/js/libs/angularjs-datepicker.js"></script>
    <script src="~/Assets/js/libs/fileinput.js"></script>
    <script src="~/Assets/js/libs/zh.js"></script>
}
